# -*- coding: utf-8 -*-
from match import Extractor
import regex as re


class daoqieExtractor(Extractor):

    # 悔罪适用于所有罪名，所以直接返回True
    @staticmethod
    def is_my_job(file_path):
        return 1

    #多次盗窃
    #入户盗窃
    #携带凶器盗窃
    #扒窃

    @staticmethod
    def extract(text):
        result = {}
        hava_duoci_daoqie = re.search(r"(多次盗窃)", text) is not None
        hava_ruhu_daoqie = re.search(r"(入户盗窃|入户)", text) is not None
        hava_xiedai_xiongqi=re.search(r"(携带凶器|凶器)", text) is not None
        have_pa_qie = re.search(r"(扒窃)", text) is not None
        result["多次盗窃"] = hava_duoci_daoqie
        result["入户盗窃"] = hava_ruhu_daoqie
        result["携带凶器盗窃"] = hava_xiedai_xiongqi
        result["扒窃"] = have_pa_qie
        return result


if __name__ == '__main__':
    print(daoqieExtractor.extract("啊啊"))
